package com.xhz.reload;

import java.lang.instrument.Instrumentation;
import java.util.Arrays;
import java.util.List;

public class Reloader {
	private Instrumentation inst;
	
	public Reloader(Instrumentation inst) {
		this.inst = inst;
	}
	
	public Result reload() {
		Result result = new Result();
		List<HotDeployer> hotDeployers = Arrays.asList(new HotDeployHotDeployer(result, inst));
		for (HotDeployer hotDeployer : hotDeployers) {
			if (!hotDeployer.exec().isResult())
				break;
		}
		return result; 
	}
}
